$(function(){
	$('#pic-container').tooltip({
		trigger: 'manual'
	}).tooltip('show');

	$('a.thumbnail').on('click',function(){
		var $this = $(this);
		var uploader = new PicUploader({
			success: function(obj) {
				var url = obj['data']
				$this.find('img').attr('src',url);
				$this.find('input[type="hidden"]').val(url);
			}
		});
		uploader.start();
	});

	$('#save-btn').on('click',function(){
		var data={};
		$("#video-edit-form input").each(function(i,inp){
			var $inp = $(inp);
			data[$inp.attr("name")]=$inp.val();
		});
		cAjax({
			url: '/web/category/editItem',
			type:'post',
			data: data,
			success:function(obj){
				greeting({msg:"保存成功",confirm:function(){window.location.reload();}});
			},
			error: function(obj) {
			}
		});
	});
});

